
package com.terrynoya.fight.stateMachine.controllers
{
	import com.terrynoya.fight.char.Character;
	import com.terrynoya.fight.combat.HitDefinition;
	import com.terrynoya.fight.stateMachine.StateController;
	import com.terrynoya.geom.MVector2D;
	
	public class HitFallVel extends StateController
	{
		public function HitFallVel(name:String)
		{
			super(name);
		}
		
		override public function run(character:Character):void
		{
			var velo:MVector2D = new MVector2D();
			var hitDef:HitDefinition = character.defensiveInfo.hitDef;
			velo.x = hitDef.fallVelocityXSetted ? hitDef.fallVelocityX : character.velocity.x;
			velo.y = character.defensiveInfo.hitDef.fallVelocityY;
			
			character.velocity = velo;
		}
	}
}